package com.framework.core;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

/**
 * 系统权限拦截器
 * @author T
 *
 */
public class AuthorityInterceptor extends HandlerInterceptorAdapter
{

	// Controller方法执行前执行此方法，返回的boolean控制拦截器链是否继续执行
	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
	{
		System.out.println(request.getRequestURI());
		System.out.println("preHandle");
		return true;
		
	}
	
	// Controller方法执行后，将进入到这里，能处理ModelAndView哦
	@Override
	public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception
	{
		
		
	}





	//输出页面执行后进入到这里，能获得Exception了 
	@Override
	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception
	{
		// TODO Auto-generated method stub
		super.afterCompletion(request, response, handler, ex);
	}
	
	
	
}
